<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Create an account</title>

    <link href="resources/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="resources/css/common.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

<div class="container">

    <form method="POST" th:object="${userForm}" action="#" th:action="@{/register}" class="form-signin">
        <h2 class="form-signin-heading">Create your account</h2>
        <div class="form-group">
            <input type="text" th:field="*{username}" class="form-control" placeholder="Username"
                   autofocus="true"/>
            <p th:if="${#fields.hasErrors('username')}" th:errors="*{username}">User name can not be null</p>
        </div>
        <div class="form-group">
            <input type="password" th:field="*{password}" class="form-control" placeholder="Password"/>
            <p th:if="${#fields.hasErrors('password')}" th:errors="*{password}">password is invalid</p>

        </div>
        <div class="form-group">
            <input type="password" th:field="*{passwordConfirm}" class="form-control"
                   placeholder="Confirm your password"/>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Submit</button>
    </form>

</div>
<!-- /container -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="resources/dist/js/bootstrap.min.js"></script>
</body>
</html>